<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简易搜索示例</title>
    <style>
        /* 新增导航栏样式 */
        .nav-bar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: #fff;
            padding: 15px 30px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 1000;
        } 
 
        .nav-links {
            display: flex;
            gap: 25px;
        }

        .nav-links a {
            color: #333;
            text-decoration: none;
            font-size: 14px;
        }

        .nav-links a:hover {
            color: #3385ff;
        }

        /* 调整原有body样式 */
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            padding-top: 70px; /* 为导航栏留出空间 */
            background: #fff;
            margin: 0;
        }

        /* 其他原有样式保持不变... */
    </style>
    <script src="./js/ajax.js"></script>
	<script src="./js/uri.js"></script> 
	<script src="./js/value.js"></script> 
</head>
<body>
    <!-- 新增导航栏 -->
    <nav class="nav-bar">
        <div class="nav-links">
            <a href="#">见闻</a>
            <a href="#">寻才</a>
         <!--  <a href="#">百业</a>    -->  
            <a href="#">百家</a>
        </div> 
        <div class="nav-links">
            <a href="#">语言</a>
            <a href="login.html">登录</a>
            <a href="register.html">注册</a>
        </div>
    </nav> 
  
    <h1>新用户注册</h1>
    <div class="search-box">
        <input type="text" name="email" placeholder="请输入邮箱地址">
        <div>
	      <input type="checkbox" name="agree" value="1">
	      <a href="about.html">
	      <label for="male">请阅读注册说明,同意请勾选</label>
	      </a>
	    </div>
        <button id="reg" onClick="reg()">注册</button>
    </div>
    <div id="results"></div>
 
</body>

<script>
   
   function reg(){
	  var agree = getInputValue("agree");
	  var email = getInputValue("email"); 
	  var lang = getInputValue("lang");
	  if(agree != 1){
		  alert("Please read , select agree first");
		  return;
	  } 
	  if(isValidEmail(email)==false){
		  alert("invalid email");
	  } 
	  if(lang==null){
		  lang="cn";  //cn:chinese, en:english
	  }
	  var json={"email":email,"lang":lang,"passwd":""}; //用户也可以预设好 密码，在激活时 提供验证码激活
	  //或者 凭验证码， 设置新的密码
	  
	  ajaxPostJson(register_uri,null,json,function(status,ret){
		  console.log("Status="+status);
		  console.log("Data="+JSON.stringify(ret,null,2)); 
		  if(ret.status == 1){
			  showPage("active.html?email="+email);
		  }else{
			  alert("返回错误代码:"+ret.errCode+"\内容:"+ret.desc);
		  }
	  });
	  
   }
   
</script>
</html>